package com.example.demo.mapper;

import com.example.demo.model.ArticleInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.ArrayList;
import java.util.List;

@Mapper
public interface ArticleMapper {
    public List<ArticleInfo> getAllById(@Param("uid") Integer uid);

    public ArticleInfo getDetails(@Param("id") Integer id);

    public int update(Integer aid,Integer uid,String title,String content);

    public List<ArticleInfo> getList(@Param("pindex") Integer pindex,
                                     @Param("offset") Integer offset);

    public Integer getTotalPage();

    //根据作者名查询文章数量
    public Integer getCountArticleByName(@Param("uid") Integer uid);

    public int insert(@Param("uid") Integer uid,@Param("title") String title,@Param("content") String content);

    //根据文章id删除文章
    public Integer deleteArtById(@Param("id")Integer id);

}
